body {
  /* min大小表示不能低于指定值，但是可以超过 */
  min-width: 100vw;
  min-height: 100vh;
  /* 背景图片 */
  background-image: url('../images/xunlei-bg.jpg');
  /* 背景图片在不变形的情况下，尽可能的显示完整图片内容 */
  background-size: cover;
  /* 如果背景图片无法完整显示，会显示图片中间的区域 */
  background-position: center center;
  /* 背景图片不会因为网页内容滚动而移动 */
  background-attachment: fixed;
}

/* 上方整体布局 */
.top-box {
  display: flex;
  padding: 0.2rem 10rem;
  justify-content: space-between;
  transition: background-color 0.5s;
  align-items: center;
}

.top-box img {
  height: 2rem;
}

.top-box img:hover {
  /* 只有带透明层的png图片才会有很好的效果 */
  filter: drop-shadow(0px 0px 5px #ffffff);
  /* box-shadow: 0px 0px 5px #ffffff; */
}

.top-box:hover {
  background-color: #000000;
}

/* 上方菜单布局 */
.top-menus-box {
  display: flex;
  color: #ffffff;
}

/* 下方有横线的div容器 */
.menu {
  margin-left: 2rem;
}
/* 菜单字符容器的效果 */
.menu > div:first-child {
  padding: 1.5rem 0.5rem;
  cursor: pointer;
}
/* 菜单下划线的效果 */
.menu > div:nth-child(2) {
  width: 100%;
  height: 0.2rem;
  background-color: #ffffff;
  /* scaleX沿着x轴缩放0-1 */
  transform: scaleX(0);
  transition: transform 0.5s;
}

.menu:hover > div:nth-child(2) {
  transform: scaleX(1);
}

/* 激活状态的菜单 */
.active > div:nth-child(2) {
  transform: scaleX(1);
}

/* 带弹出菜单的菜单 */
.submenu {
  position: relative;
}
.submenu > div:nth-child(3) {
  position: absolute;
  transform: scaleY(0);
  /* 调整变形的中心点 */
  transform-origin: top center;
  transition: transform 0.5s;
  background-color: #000000;
  padding: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  width: 5rem;
  text-align: center;
}

.submenu > div:nth-child(3) > div {
  padding: 0.5rem 0px;
  border-bottom: 1px solid #acacac;
}

.submenu > div:nth-child(3) > div:last-child {
  border-bottom-width: 0px;
}

.submenu > div:nth-child(3) > div:hover {
  color: #0000ff;
  cursor: pointer;
}

.submenu:hover > div:nth-child(3) {
  transform: scaleY(1);
}

/* 通过样式模拟点击菜单效果 */
.click-menus-box {
  display: flex;
  margin: 1rem;
  color: #ffffff;
}

.click-menus {
  position: relative;
}

.click-menus > div:nth-child(2) {
  position: absolute;
  transform: scaleY(0);
  transition: transform 0.5;
}
/* :focus-within伪类，当元素或者里面的元素拥有焦点 */
.click-menus:focus-within > div:nth-child(1) {
  color: #ff0000;
}

.click-menus:focus-within > div:nth-child(2) {
  transform: scaleY(1);
}

/* 隐藏input元素 */
.click-menus input {
  width: 0px;
}
